Apparatus and method for timetabling reality time process

ABSTRACT

A method for scheduling of periodic real time processes in an operating system, comprising the steps of defining a reference point in time for a periodic real time process, and scheduling the periodic real time process from said reference point in time. Preferably a future point in time is defined as said reference point in time at the start up of the operating system. Said real time process is preferably a periodic control process during which a relative control point in time, counted from the beginning of the subsequent control cycle, is calculated during each cycle with absolute time correction counted from said reference point in time. Said absolute time correction corresponds to the period of the periodic process multiplied with the number of passed control periods until said beginning of the subsequent control cycle, at which said absolute control point in time is calculated through an addition of said relative control point in time with said absolute time correction. In one embodiment the method according to the invention is applied in an active filter for compensation of variations in an apparatus current consumption from a power grid as a result of changes in the apparatus&#39; electrical load.

The present invention relates to scheduling of real time processes in operating systems for computer systems, specifically to real time processes scheduled with absolute reference time. A preferred field of application for the invention is control of active filters for suppression of disturbances and power savings in the power supply of electrical apparatus.

BACKGROUND

During scheduling of periodically executing real time processes in the operating system of a computer system, the temporal resolution is usually directly dependent of the resolution of the clock with which the process is periodically scheduled. In for example control systems exploiting real time processes with absolute reference time, an erroneously computed time results in negative consequences. Often several points in time are computed during one control cycle. Assume a control system operating with three parameters of time. During scheduling of the real time processes the following holds true:

-   -   for each control cycle, three points in time are established         which shall be scheduled relative to the current cycle (relative         time);     -   the control process, performing the calculation of the three         points in time, runs periodically;     -   an absolute reference time is demanded;     -   the temporal resolution with which the process scheduled three         times per control cycle is of a given size, for example 1 μs;         If the clock frequency is drifting from its intended value,         which all clock's frequency does to a certain extent, the error         added to the computed points in time for the three parameters of         time will constantly increase. The result is that a control         deadline will be missed which will cause deteoriated control         performance in the best case, or machine failure in the worst         case. This means that the such a process works in so called hard         real time.

One purpose of the present invention is to make available a method for scheduling real time processes with absolute reference time.

SUMMARY OF THE INVENTION

The present invention relates, according to a first aspect, to a method for scheduling periodic real time processes in an operating system, comprising the steps to define a reference point in time for a periodic real time process, and to schedule the periodic real time process from said reference point in time.

Preferably a future point in time is defined as said reference point in time. In one embodiment said reference time in point is defined at the start up of the operating system, prior to the first process cycle. Preferably the first cycle of the real time process begins at said point in time.

In one embodiment said real time process is a periodic control process under which a relative control point in time, counted from the beginning of the subsequent control cycle, is calculated during each cycle. Preferably said relative point in time is recalculated to a absolute control point in time with absolute time correction from said reference point in time. In one embodiment said absolute time correction corresponds to the period of the periodic process multiplied with the amount of passed control cycles until said start of the subsequent control cycle, at which said absolute control point in time is calculated through an addition of said relative control point in time with said absolute time correction.

In one embodiment the method according to the invention is applied in an active filter compensating for variations in the current consumption from the power grid of an apparatus as a result of changes of the apparatus electrical load, which active filter for each of the power grids phases comprises a transistor bridge connected between each mentioned phase and a DC-link, whose transistor bridges are controlled by said periodic real time process. Preferably in such an embodiment, a separate control time in point is calculated for each phase during each cycle. In a variation of this embodiment further a control point in time is separately computed for the neutral line during each control cycle.

The present invention further intends to, according to a second aspect, a computer program product, for use in a computer system for processing and storage of data, for scheduling of periodic real time processes in an operating system for said computer system, comprising:

-   -   a storage medium;     -   means, stored on said storage medium, to define a reference         point in time for a periodic real time process; and means,         stored on said storage medium, to schedule the periodic real         time process periodically from said reference point in time.

In one embodiment the computer program product further comprises means, stored on said storage medium, to define a future point in time as said reference point in time. Preferably the computer program product comprises further means, stored on said storage medium, to define said reference point in time during start up of the operating system, prior to the first process cycle. In one embodiment the computer program product comprises further means, stored on said data storage medium, to begin the first cycle of the real time process at said reference point in time.

In one embodiment the computer program product further comprises means, stored on said storage medium, in order to calculate a relative control point in time, counted from the beginning of the subsequent control cycle, during each control cycle. Preferably the computer program product comprises further means, stored on said storage medium, to recalculate said relative control point in time to an absolute control point in time counted from said reference point in time.

In one embodiment, where said absolute time correction corresponds to the period of the periodic process multiplied with the number of passed control periods until said beginning of the subsequent control cycle, the computer program product further comprises means, stored on said data storage medium, to calculate said absolute control point in time through an addition of said relative control time in point with said absolute time correction.

In a preferred embodiment, arranged in a control device in an active filter for compensation of variations of an apparatus current consumption from a power grid as a result of variations in the apparatus' electrical load, which active filters for each of the power grids three phases comprises a transistor bridge connected between each aforementioned phase and a DC-link, comprising said computer program product further means, stored on said storage medium, to control said transistor bridge with said periodic control process. Preferably the computer program product in the aforementioned embodiment comprises further means, stored on said storage medium, to separately calculate a control point in time for each phase during a control cycle. In one embodiment the computer program product further comprises means, stored on said storage medium, to separately calculate a control point in time for the neutral line during a control cycle.

The present invention further intends to, according to a third aspect, an active filter for compensation of variations of an apparatus current consumption from a power grid as a result of variations in the apparatus' electrical load, comprising a transistor bridge arranged for reversal of the current direction connected between each of the power grids three phases and a DC-link, further comprising a control system which partly includes means to measure load currents to said apparatus and in these identify unwished frequency components, and partly means to control current direction, strength of the current and frequency components between the phases through the DC-link in such a manner that said undesired frequency components are put out, which control system comprises means to operate with a periodic real time process according to any of the aforementioned method steps.

BRIEF DESCRIPTION OF THE DRAWINGS

A preferred embodiment is described in detail below with reference to attached figures, in which

FIG. 1. schematically illustrates parts of the circuit design for an active filter in which the scheduling of real time processes according to the present invention is applied in an embodiment;

FIG. 2. schematically illustrates the scheduling according to the present invention in a time diagram.

DETAILED DESCRIPTION OF A PREFERRED EMBODIMENT

Different embodiments of the present invention can be realized in a multitude of applications where scheduling of real time processes is utilized. In order to put the invention in a specific perspective an application is presented here within active filters for compensation of variations of an apparatus current consumption from a power grid, which variations are caused by variations in the apparatus electrical load, at which active frequency filtering and dynamic compensation of reactive energy/current is applied. The skilled person will however realize that this embodiment is solely one of a multitude of possible examples. Distinctive features of the scheduling principle are presented further on with reference to FIG. 2.

A load giving the least possible losses in relation to its performed work in an electrical system is a load with purely resistive impedance. However, in most cases the impedance of the load an electrical apparatus constitutes almost always contains an inductive or capacitive component, which means that the current consumed from the feeding grid not always will be in phase with the source voltage. Furthermore, many electrical apparatus comprises active components that have a dynamically varying load, i.e. the load varies with time. Such electrical apparatus includes among others the types of apparatus converting electrical power to work, such as cranes or workshop machines. It is obvious that for example a sheet press device has an increased current consumption during active press duty than when the device is only idling. Common for this type of apparatuses is that they comprise a dynamic power supply. Furthermore, in many cases the dynamics are unpredictable, in the sense that the load changes have an uneven or indeed random periodicity, or impedance that varies in strength over time. For such processes, calculation and averaging of the current consumption can as a rule not be utilized in a satisfactory way in order to compensate the load changes. A consequence of such load behaviours is that current transients is formed in the power grid causing to a certain extent increased current consumption depending on energy content, and mainly causing problems for other sensitive equipment connected to the power grid.

In order to solve the problem with the influence of dynamic loads on the power grid so called active filters have been developed, adapted for compensating load variations. An active filter is in principle a microprocessor controlled amplifier which is connected to the power grid, and which is arranged to sense and compensate the load's current consumption in regard to frequencies which would not exist if the load was purely resistive. The active filter at that comprises a main circuit with one or a series of fast switches for each phase. Each such switch preferably comprises a transistor, a diode and a protection circuit in the form of a so-called snubber. These switches are connected to a DC-link that can accumulate electrical energy. The power grid's current provision and the load's current consumption are measured periodically and using pulse width modulation the current direction for the transistor circuits are reversed in such a manner that the current provided by the active filter results in a current drawn from the power grid that is in phase with the voltage and liberated from disturbances. Said switches generally comprise so-called IGBTs, Insulated Gate Bipolar Transistor, but can also be realized with other transistor types, for example MOSFET. Preferably the aforementioned main circuit is connected to each of the three phases of the power grids using inductors. Further, for each phase connection a circuit breaker is preferably arranged between the active filter's main circuit and the phases.

At loads varying unevenly between the phases disturbances may leak to the electrical neutral line. A problem with the thereby generated so-called null currents is that they may become non-neglectable and thereby cause problems in other equipment.

In a simultaneously filed patent application by the inventors for the present application, this is solved by an active filter for compensation of variations in an apparatus' current consumption from a power grid as a cause of changes in the apparatus' electrical load, which filter comprises a switch arranged for reversal of the current direction connected between the neutral line in the power grid and a DC-link.

Parts of a power supply device with an active filter, which are relevant to the invention, are schematically shown for a preferred embodiment in FIG. 1. A power grid 1 is connected via a power supply connection 2 to an electrical apparatus 3. The power grid 1 is a three phase system with three phases a, b, c and neutral line 0, and the power supply connection 2 has separates conductors 2 a, 2 b, 2 c for each phase and neutral line conductor 20. Apparatus 3 comprises or constitutes preferably a load with dynamic impedance.

An active filter 4, indicated by the dotted and dashed line, comprises an electrical main circuit comprising transistor connections Ta, Tb, Tc and T0 of pair-wise switches or transistor circuits TaU and TaD, ThU and TbD, TcU and TcD for each phase, and additionally a pair-wise switch or transistor-circuit T0U and T0D for the neutral line. Here U denotes the in the figure upper switches and D the lower switches. Each transistor circuit TaU, TaD, TbU, TbD, TcU, TcD, T0U, T0D comprises a transistor with a diode and a snubber, connected in parallel with emitter and collector on the transistor. For each phase and for the neutral line the pair of transistor circuits are in one end connected to each other, and their other ends connected to opposite sides to one for all transistor circuits Ta, Th, Tc, T0 common DC-link 7. The DC-link 7 comprises in the illustrated embodiment three series connected elements of each one capacitor and one resistor which are connected in parallel. The professional skilled within the known art will however realize that the specific design of the DC-link 7 is not decisive for the invention, and that a multitude of alternative arrangements for the DC-link are well known in the art. The DC-link 7 is accordingly connected in parallel with all transistor pairs or switches Ta, Tb, Tc, T0.

Via a conductor interface 5 with circuit breakers the active filter 4 is connectable to each conductor 2 a, 2 b, 2 c, 20 in the power supply connection 2. For this purpose the active filter 4 is arranged with a conductor connection 6 comprising separate conductors 6 a, 6 b, 6 c 60 arranged in order to via conductor interface 5 connect each transistor pair Ta, Th, Tc, T0 to a conductor 2 a, 2 b, 2 c, 20 at said each ends of the transistor circuits. Preferably each connection 6 a, 6 b, 6 c, 60 comprises an inductor 8 a, 8 b, 8 c, 80.

A control device 9 in the active filter 4 further constitutes the filter's control system, and is arranged for control of the transistors in the filter. Said transistors are preferably constituted of IGBTs that can be activated very quickly, but can also be constituted of for example MOSFETs. The control device 9 encompasses a control computer with microprocessors in which the points in time for which the control pulses to the switches are calculated, the control pulses from which the switches are trigged. The current in the load 3, three phases and the neutral line, and the voltage in the power grid 1 is sampled into the control computer together with the DC-voltage in the link 7 and the current in the filter's three phases and neutral line. From the load currents the undesired frequency components are identified in a way well known in the art. These components, preferably represented in rotating coordinate systems, are used with reversed sign as reference value. The filter 4 then produces the same components as in the load 1 but with reversed sign, which gives measurement values. This make the load's and filter's components theoretically put out each other, and the compensation for the loads undesired behaviour in consumptions must no longer be supplied from the power grid but are supplied by the filter. For maintenance of the DC-link's 7 voltage there exists, integrated with other automatic control, an addition in the automatic control rules functions considering that said DC-links voltage must be maintained at a stable level in order for the filter to generate compensations currents in the different phases and the neutral line. The control system which the control device 9 realizes has as in parameters voltage Va, Vb, Vc on the power grids 1 conductors 2 a, 2 b, 2 c, as well as the load currents I1 a, I1 b, I1 c, I1 n and the filter currents Ifa, Ifb, Ifc, Ifn on the phases a, b, c and the neutral line n or 0.

With help from the active filter according to the present invention there will thus not only occur compensation for load changes on the phases a, b, c but also on the neutral line 0/n. This results in a lowered or eliminated risk of neutral line current in the power grid 1, with the effect that energy losses and the risk of damage on apparatus connected to the power grid can be minimized.

In FIG. 2 it is shown with an example how the scheduling according to the present invention is performed. The idea is to introduce a reference point in time to at one point in time during system start up that is considered well defined. All time calculations and scheduling of processes will then occur relative to this reference point in time t₀. In this way simple time calculations and good scheduling performance are accomplished. The technique can be summarized in the following steps, which refer to FIG. 2:

-   1. During system start up, preferably prior to the first control     cycle, a start point in time or a reference point in time t₀ is set     when the first scheduling occurs. The start time t₀ is in the     future, and is defined at the vertical arrow in the figure, that is     to say prior to the point in time t₀. -   2. The control process is now scheduled periodically with starting     point t₀. Thus each starting point for the control process is given     in absolute time with the period as time increment. -   3. During each control cycle the control process is executing for a     certain time, in the figure represented by the upper blocks starting     at the beginning of each cycle. In the example with active filters     the control process shall under each cycle or period n calculate     three points in time for the phases a, b, c, and eventually yet     another one for the neutral line 0 (not shown in the figure). All of     these three or four points in time occur in the subsequent control     cycle n+1. These points in time are relative next cycle's n+1     beginning and are called t_(an), t_(bn), t_(cn). -   4. The three times t_(an), t_(bn), t_(cn) are recalculated to     absolute time relative to the starting time t₀. The new times are     called t_(aabsn), t_(babsn), t_(cabsn) -   5. The process is scheduled in the real time clock after sorting of     the times.

The professional skilled within the known art realizes that the points in time t_(aabsn), t_(babsn), t_(cabsn) which are calculated later on will be used to schedule other real time processes than said that performs the calculation, in the present embodiment in order to trig the transistor bridges.

The above procedure gives quite a few advantages. The time handling in the control process becomes trivial when the control algorithm can use relative times, which is natural in accordance with the control algorithm. In all control systems there is always a clock error, but since both sampling and scheduling occurs according to the same start time (t₀) the effect of the time error is eliminated—when the control process is calculating relative time internally the calculation becomes exact. The practical effect is that the timing error of the hardware clock is eliminated. The system is computationally efficient, as small integers are sufficient to represent relative times. 64-bit integers are only used during conversion to absolute time, i.e., in the instant of scheduling (t_(aabsn), t_(babsn), t_(cabsn) are 64-bit integers).

For the embodiment active filters that are operating with pulse width modulation the present invention is extremely advantageous, when one does not have to utilize programmable logic in the form of FPGA in order to avoid timing errors. Thus one gets away with less hardware than in previous systems known to the art. Preferably the control process is realized in RTLinux, or a corresponding operating system in a computer system comprising a processor with associated memory. With the present invention a method is received for scheduling of real time processes with absolute reference time utilizing only a conventional clock, without synchronization from the surrounding world. The absolute time reference demanded is absolute in the sense that the surrounding world and the control system, or in general the real time operating system, shall have the same notion of the instantaneous time.

Distinctive features for the invention above have been described with help of an example of an embodiment. The professional skilled within the known art however realizes that modifications of said embodiment can be made within the frames that are defined by the enclosed claims. 

1. Method for scheduling periodic real time processes in an operating system, comprising the steps of defining a reference point in time for a periodic real time process, and scheduling the periodic real time processes from said reference point in time.
 2. The method according to claim 1, wherein a future point in time is defined as said reference point in time.
 3. The method according to claim 2, wherein said reference point in time is defined at the start up of the operating system before a first process cycle.
 4. The method according to claim 3, at which the first cycle of the real time process is begun at said reference point in time.
 5. The method according to claim 4, where said real time process is a periodic control process during which a relative control point in time, counted from the beginning of an immediately subsequent control cycle, is calculated during each cycle.
 6. The method according to claim 5, where said relative control point in time is recalculated to an absolute control point in time with absolute time correction counted from said reference point in time.
 7. The method according to claim 6, where said absolute time correction corresponds to the period of the periodic process multiplied with the number of passed control periods up until said beginning of the subsequent control cycle, at which said absolute control point in time is calculated through an addition of said relative control point in time with said absolute time correction.
 8. The method according to claim 7, applied in an active filter for compensation of variations in an apparatus current consumption from a power grid as a result of variations in the apparatus electrical load, which active filter for each one of the power grid's phases comprises a transistor bridge connected between said each phase and a DC-link, which transistor bridges are controlled by said periodic real time process.
 9. The method according to claim 8, at which a separate control point in time is calculated for each phase during one control cycle.
 10. The method according to claim 9, at which a separate control point in time is calculated for the neutral line during one control cycle.
 11. A computer program product, for use in a computer system for processing and storage of data, for scheduling of periodic real time processes in an operating system for said computer system, comprising: a data storage medium; means, stored on said data storage medium, for defining a reference point in time for a periodic real time process; and means, stored on said data storage medium, for scheduling the periodic real time process periodically from said reference point in time.
 12. The computer program product according to claim 11, further comprising means, stored on said data storage medium, for defining a future point in time as said reference point in time.
 13. The computer program product according to claim 12, further comprising means, stored on said data storage medium, for defining said reference point in time at start up of the operating system, prior to a first process cycle.
 14. The computer program product according to claim 13, further comprising means, stored on said data storage medium, to starting the first cycle of the real time process at said reference point in time.
 15. The computer program product according to claim 14, where said real time process is a periodic real time process, further comprising means, stored on said storage medium, for, during said control process, calculating a relative control point in time, counted from the beginning of the subsequent control cycle, during each cycle.
 16. The computer program product according to claim 15, further comprising means, stored on said data storage medium, for recalculating said relative control point in time to an absolute control point in time with absolute time correction counted from said reference point in time.
 17. The computer program product according to claim 12, where said absolute time correction corresponds to the period of the periodic process multiplied with the number of prior control periods until said beginning of the subsequent control cycle, further comprising means, stored on said data storage medium, for calculating said absolute control point in time through addition of said relative control point in time to said absolute time correction.
 18. The computer program product, according to claim 17, arranged in a control device in an active filter for compensation of variations in an apparatus current consumption from a power grid as a result of variations in the apparatus' electrical load, which active filter for each of the power grids phases comprises a transistor bridge connected between each of said phases and a DC-link, further encompassing means, stored on said data storage medium, for controlling said transistor bridges with said periodic real time process.
 19. The computer program product according to claim 18, further comprising means, stored on said storage medium, for separately calculating a control point in time for each phase during a control cycle.
 20. The computer program product according to claim 19, further comprising means, stored on said data storage medium, for separately calculating a control point in time for the neutral line during a control cycle.
 21. Active filter for compensation of variations in an apparatus current consumption from a power grid as a result of variations in the apparatus' electrical loads, comprising a transistor bridge arranged for reversal of the current direction connected between each of the power grids three phases and a DC-link, further comprising a control system which partly comprises means for measuring load currents to said apparatus and in these identify undesired frequency components, and partly means for controlling current direction, current magnitude and frequency content between the phases through the DC-link in such a manner that said frequency components are extinguished, which control system comprises means for operating with a periodic real time process according to the method steps in claim
 10. 